package taller2.view.menus.supervisor;

import java.awt.Color;
import java.awt.GridBagLayout;

import javax.swing.JComboBox;
import javax.swing.JPanel;
import javax.swing.JSlider;

import taller2.controller.listeners.GraphCreator.GraphCreatorMenuListener;
import taller2.controller.listeners.GraphCreator.GraphCreatorSizeListener;
import taller2.interfaces.Graph;
import taller2.utils.Constants;
import taller2.utils.Utils;
import taller2.view.draws.DrawingArea;
import taller2.view.windows.supervisor.SupervisorWindow;

public class GraphSupervisorMenu extends JPanel{
	private static final long serialVersionUID = 1L;

	protected JComboBox<String> options;
	private JSlider sizeSelector;
//	private JToggleButton applyChangesButton;
	
	// constructor
	public GraphSupervisorMenu(DrawingArea area,Graph graph,SupervisorWindow window){
		sizeSelector = new JSlider(10, 100);
		sizeSelector.addChangeListener(new GraphCreatorSizeListener(area));
						
		createOptions(area,graph);
				
//		applyChangesButton = new JToggleButton("applyChanges");
//		applyChangesButton.addActionListener(new GraphCreatorApplyChangesButtonListener(window,this));	

		setLayout(new GridBagLayout());
		
		Utils.addComponent(this,options,0.25,1,new taller2.utils.Point(0,0));
//		Utils.addComponent(this,applyChangesButton,0.15,1,new taller2.utils.Point(3,0));
		Utils.addComponent(this,sizeSelector,0.4,1,new taller2.utils.Point(2,0));
	}
	
	protected void createOptions(DrawingArea area,Graph graph){
		options = new JComboBox<String>(Constants.availableOptions);
		options.setSelectedIndex(0);
		options.setBackground(new Color(0,0,0));
		options.addActionListener(new GraphCreatorMenuListener(area,graph, null));
	}

		
    // unselects all buttons
    public void unselectButtons(){
 //   	applyChangesButton.setSelected(false);
    }  
}
